package com.test.message;

public enum MessageType {
	
	TEXT_MESSAGE(1),
	IMAGE_MESSAGE(2),
	VOICE_MESSAGE(3),
	VEDIO_MESSAGE(4),
	ACTION_MESSAGE(5),
	ONLINE_USER_MESSAGE(6);
	
	private int type;
	
	private MessageType (int type) {
		this.type = type;
	}
	
	public static int getType(Class<?> clzz) {
		if(clzz == TextMessage.class) {
			return 1;
		}
		if(clzz == ImageMessage.class) {
			return 2;
		}
		if(clzz == VoiceMessage.class) {
			return 3;
		}
		if(clzz == VideoMessage.class) {
			return 4;
		}
		if(clzz == ActionMessage.class) {
			return 5;
		}
		if(clzz == OnlineUserMessage.class) {
			return 6;
		}
		
		return 0;
	}

}
